var zoom=cc.Class({
    extends: cc.Component,

    properties: {
        click:0,
        clicktime:0
        // foo: {
        //    default: null,      // The default value will be used only when the component attaching
        //                           to a node for the first time
        //    url: cc.Texture2D,  // optional, default is typeof default
        //    serializable: true, // optional, default is true
        //    visible: true,      // optional, default is true
        //    displayName: 'Foo', // optional
        //    readonly: false,    // optional, default is false
        // },
        // ...
    },

    // use this for initialization
    onLoad: function () {
        var self=this;
        this.node.on(cc.Node.EventType.TOUCH_END, function(event) {
           if(self.click===0){
               //第一次按下
               self.click=1;
               self.clicktime=Date.now();
           }else if(self.click==1){
               //第二次按下
               var clicktime2=Date.now()-self.clicktime;
               cc.log('差：'+clicktime2);
               //dosomething
               if(clicktime2<1000){//这是连续间隔
                self.doubleclick(event);
               }
               self.click=0;
               self.clicktime=0;
           }else{
               self.click=0;
               self.clicktime=0;
           }
        });
        this.node.on(cc.Node.EventType.TOUCH_MOVE, function(event) {
            self.click=0;
            self.clicktime=0;
        });
        this.schedule(function(){
            var clicktime2=Date.now()-self.clicktime;
            if(clicktime2>1000){
                self.click=0;
            }
        },0);    
    },
    doubleclick:function(event){}
    // called every frame, uncomment this function to activate update callback
    // update: function (dt) {

    // },
});
